<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script>
function download_txt(filename,content,contentType)
{
	if (!contentType) contentType = 'application/octet-stream';
	var a = document.createElement('a');
	var blob = new Blob([content],{ 'type': contentType });
	a.href = window.URL.createObjectURL(blob);
	a.download = filename;
	a.click();
}
if(localStorage['last-chat'])
{
	let last_chat = JSON.parse(localStorage['last-chat']);
	if(localStorage['custom-characters'])
	{
		let custom_chars = JSON.parse(localStorage['custom-characters']);
		custom_chars.map(function(v,k)
		{
			custom_chars[k].img = custom_chars[k].image
			custom_chars[k].name = custom_chars[k].names['zh-cn']
			custom_chars[k].char_id = custom_chars[k].id
			delete custom_chars[k].image
			delete custom_chars[k].names
			delete custom_chars[k].id
		})
		last_chat.custom_chars = custom_chars
	}
	download_txt('closuretalk存档.json',JSON.stringify(last_chat),'application/json')
}

if(confirm('此网站停用\n点击“确定”跳转新网址'))
{
	window.location.replace('https://closuretalk-ggg555ttt-dfac17880f8c693eca26c2febcfbedfeda4494b71.gitlab.io/')
}

</script>